Function: cond-let--and>

cond-let--and> is a macro defined in cond-let.el.

Signature

(cond-let--and> FORM FORM...)

Documentation

Bind variables according to each VARFORM until one of them yields nil.

Evaluate the first FORM and if that yields a non-nil value, bind the symbol $ to that value, and evaluate the next FORM with that binding in effect. Repeat this process with subsequent FORMs until one yields nil, then return nil without evaluate the remaining FORMs. If all FORMs yield non-nil, return the value of the last FORM.

Source Code

;; Defined in ~/.emacs.d/elpa/cond-let-20260201.1500/cond-let.el
(defmacro cond-let--and> (form form2 &rest forms)
  "Bind variables according to each VARFORM until one of them yields nil.

Evaluate the first FORM and if that yields a non-nil value, bind the
symbol `$' to that value, and evaluate the next FORM with that binding
in effect.  Repeat this process with subsequent FORMs until one yields
nil, then return nil without evaluate the remaining FORMs.  If all
FORMs yield non-nil, return the value of the last FORM.

\(fn FORM FORM...)"
  (declare (debug (form form body)))
  `(,(if forms 'let* 'let)
    (($ ,form)
     ,@(and forms
            (mapcar (lambda (form)
                      `($ (and $ ,form)))
                    (cons form2 (butlast forms)))))
    (and $
         ,(or (car (last forms))
              form2))))